<?php
/*
* Template Name: List Rent Properties
*/
get_header(); 

// To Show Banner and Title
get_template_part( 'inc/title-bar' ); 
?>

		<!--OPENING CONTENT-->
		<div id="content" class="property-listing-page">
		        
		        
		        <?php 
				// Include Breadcrumb Bar
				get_template_part( 'inc/breadcrumb-sharebar' ); 
				?>
		          		       
				<div class="listing">
						<?php 
							$properties_per_page = 6;
							
							if( function_exists( 'ot_get_option' ) )
							{								
								$properties_per_page = intval(ot_get_option('properties_per_page'));
							}
							
							$args = array(
										'post_type' => 'property',
										'posts_per_page' => $properties_per_page,
										'paged' => $paged,
										'meta_query' => array( 
															array(
																'key' => 'locality_status',
																'value' => 'for-rent',
																'compare' => '='	
															)
														)
									);
							
							$query = new WP_Query( $args );
						
							$i = 0;						
							if ( $query->have_posts() ) 
							{
								
								while ( $query->have_posts() ) : 
									
									$query->the_post(); 
									$i++;
															
										?>			                
										<div class="property-item <?php if ($i % 2 == 0) { echo "even"; } ?>" >
											<?php get_template_part( 'inc/display-property' ); ?>                        
					                	</div>							 
									 	<?php
																		
									 if ($i % 2 == 0) 
									 {
										 echo '<hr/>';						 
									 }
									 							 				 
						 		endwhile;
							}
					?>			                
		     	
				</div>
				
		        <!-- PAGINATION -->
		        <?php theme_pagination($query->max_num_pages); ?>
		        
		</div><!-- CLOSING CONTENT-->

<!-- SIDEBAR -->
<?php get_sidebar('blog'); ?>

<!-- FOOTER -->
<?php get_footer(); ?>